<local:DocumentBase x:Class="WPFExcelReport.YCAFS05CHGS"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"  
                   Background="White"
                    Loaded="Window_Loaded"
     >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:QtyColorConverter  x:Key="qtyc"/>
        <db:SETINTEXDB  x:Key="SetProd" />
        <db:SETINTEXDB  x:Key="SetData"/>
        <CollectionViewSource   x:Key="vwFSSTUELI" Source="{Binding Path=FSSTUELI,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwABPOS" Source="{Binding Path=ABPOS,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwWDECK" Source="{Binding Path=WDECK,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwFDECK" Source="{Binding Path=FDECK,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwTMPFSSTUELI" Source="{Binding Path=FSSTUELI,Source={StaticResource SetProd}}" />
    </local:DocumentBase.Resources>
    <Grid   >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="1*"/>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
            <WrapPanel>
                <StackPanel>
                    <Button FontSize="18" Height="40" Width="40" Margin="5,0,0,0" Name="btnQuerySData" Click="btnQuerySData_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="Image/Find.png" />
                        </Button.Background>
                    </Button>
                </StackPanel>
                <StackPanel>
                    <TextBlock FontSize="18"   Width="Auto"  Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=原料}}" />
                </StackPanel>
                <StackPanel>
                    <TextBox Background="Yellow"  FontSize="18"    Width="180" Name="txtMAT" CharacterCasing="Upper"  Text="" />
                </StackPanel>
            </WrapPanel>
        </StackPanel>
        <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="1">
            <TextBlock Name="txtMessage" Width="300"></TextBlock>
            <StackPanel Grid.Row="1" Grid.Column="0" >
                <WrapPanel>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=当前款式:}}"></TextBlock>
                    <TextBlock Background="LightCyan" Foreground="Red" Width="120"  Name="txtFART" HorizontalAlignment="Left"></TextBlock>
                    <Button Width="Auto"  FontSize="18"  Margin="10,0,0,0"  HorizontalAlignment="Left" Click="btnFilterMat_Click">过滤</Button>
                    <!--Button Width="Auto"  FontSize="18"  Margin="10,0,0,0"  HorizontalAlignment="Left" Click="btnTakeOver_Click">预备</Button-->
                    <Button Width="Auto"   FontSize="18"  Margin="10,0,0,0" HorizontalAlignment="Left" Click="btnFilterMatClear_Click">清除</Button>
                </WrapPanel>
                <WrapPanel>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=款式}}"></TextBlock>
                    <TextBlock Background="Yellow" Width="120" Text="{Binding FSSART, Source={StaticResource ResourceKey=vwTMPFSSTUELI}}"></TextBlock>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=色号}}"></TextBlock>
                    <TextBlock Background="LightBlue" Width="80" Text="{Binding FSSFARBE, Source={StaticResource ResourceKey=vwTMPFSSTUELI}}"></TextBlock>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=尺码}}"></TextBlock>
                    <TextBlock Background="LightPink" Width="80" Text="{Binding FSSGROE, Source={StaticResource ResourceKey=vwTMPFSSTUELI}}"></TextBlock>
                </WrapPanel>
            </StackPanel>
            <StackPanel  Grid.Row="2" Grid.Column="0" >
                <WrapPanel>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=原料}}"></TextBlock>
                    <TextBlock Width="120" Text="{Binding FSSMART, Source={StaticResource ResourceKey=vwTMPFSSTUELI}}"></TextBlock>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=色号}}"></TextBlock>
                    <TextBlock  Width="80" Text="{Binding FSSMFARBE, Source={StaticResource ResourceKey=vwTMPFSSTUELI}}"></TextBlock>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=尺码}}"></TextBlock>
                    <TextBlock Width="80" Text="{Binding FSSMGROE, Source={StaticResource ResourceKey=vwTMPFSSTUELI}}"></TextBlock>
                </WrapPanel>
                <WrapPanel>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=用量}}"></TextBlock>
                    <TextBox Name="txtSQTY" Background="White"   Text="{Binding FSSVERBR, Source={StaticResource ResourceKey=vwTMPFSSTUELI}, Converter={StaticResource ResourceKey=d1000}}" Width="80"></TextBox>
                    <TextBox  Background="White"  Text="{Binding FSSVBME, Source={StaticResource ResourceKey=vwTMPFSSTUELI}}" Width="40"></TextBox>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=损耗%}}"></TextBlock>
                    <TextBox Name="txtSWASTAGE" Background="White"  Text="{Binding FSSVERL, Source={StaticResource ResourceKey=vwTMPFSSTUELI}, Converter={StaticResource ResourceKey=d100}}" Width="40"></TextBox>
                    <Button Click="btnSame_Click" Margin="30,0,0,0" Height="40" Width="40">
                        <Button.Background>
                            <ImageBrush  ImageSource="Image/Convert.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=所有}}"></TextBlock>

                    <Button Name="btnRefreshFS05" Click="btnRefreshFS05_Click" Margin="0,0,0,0" Height="40" Width="40">
                        <Button.Background>
                            <ImageBrush  ImageSource="Image/Reload.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=刷新BOM}}" Margin="0,0,0,0" ></TextBlock>
                </WrapPanel>
            </StackPanel>
            <DataGrid  
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwTMPFSSTUELI}}"  
                AutoGenerateColumns="False"
                EnableRowVirtualization="False"
                VerticalScrollBarVisibility="Auto"
                HorizontalScrollBarVisibility="Auto"
                VerticalAlignment="Stretch"
                HeadersVisibility="Column" 
                Height="120"
                FontSize="14"
                IsReadOnly="True"
                HorizontalAlignment="Stretch"
                RowDetailsVisibilityMode="Visible">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=FSABEZ, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=描述}}" Width="Auto" MinWidth="120" />
                    <DataGridTextColumn Binding="{Binding Path=FSSART, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=款式}}" Width="Auto" MinWidth="120" />
                    <DataGridTextColumn Binding="{Binding Path=FSSPOS}" Header="{Binding Source={Localization:Translate Word=行}}" Width="Auto" MinWidth="20" />
                    <DataGridTextColumn Binding="{Binding Path=FSSFARBE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto" MinWidth="60" />
                    <DataGridTextColumn Binding="{Binding Path=FSSGROE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=尺码}}" Width="Auto" MinWidth="60" />
                    <DataGridTextColumn Binding="{Binding Path=FSSMART, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=物料}}" Width="Auto" MinWidth="120" />
                    <DataGridTextColumn Binding="{Binding Path=FSSMFARBE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto" MinWidth="60" />
                    <DataGridTextColumn Binding="{Binding Path=FSSMGROE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=尺寸}}" Width="Auto" MinWidth="60" />
                </DataGrid.Columns>
            </DataGrid>
            <DataGrid  
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwFSSTUELI}}"  
                AutoGenerateColumns="False"
                Name="dlgFSSTUELI"
                EnableRowVirtualization="False"
                VerticalScrollBarVisibility="Auto"
                HorizontalScrollBarVisibility="Auto"
                VerticalAlignment="Stretch"
                HeadersVisibility="Column" 
                Height="300"
                FontSize="14"
                IsReadOnly="True"
                HorizontalAlignment="Stretch"
                RowDetailsVisibilityMode="Visible">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=FSABEZ, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=描述}}" Width="Auto" MinWidth="120" />
                    <DataGridTextColumn Binding="{Binding Path=FSSART, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=款式}}" Width="Auto" MinWidth="120" />
                    <DataGridTextColumn Binding="{Binding Path=FSSPOS}" Header="{Binding Source={Localization:Translate Word=行}}" Width="Auto" MinWidth="20" />
                    <DataGridTextColumn Binding="{Binding Path=FSSFARBE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto" MinWidth="60" />
                    <DataGridTextColumn Binding="{Binding Path=FSSGROE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=尺码}}" Width="Auto" MinWidth="60" />
                    <DataGridTextColumn Binding="{Binding Path=FSSMART, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=物料}}" Width="Auto" MinWidth="120" />
                    <DataGridTextColumn Binding="{Binding Path=FSSMFARBE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto" MinWidth="60" />
                    <DataGridTextColumn Binding="{Binding Path=FSSMGROE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=尺寸}}" Width="Auto" MinWidth="60" />
                </DataGrid.Columns>
            </DataGrid>
        </StackPanel>
        <StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="1">
            <WrapPanel>
                <StackPanel>
                    <WrapPanel>
                        <TextBlock Text="请逐个选择左边的BOM，执行替换"></TextBlock>
                    </WrapPanel>
                    <WrapPanel>
                        <TextBlock Text="{Binding Source={Localization:Translate Word=新比例:}}"></TextBlock>
                        <TextBlock Name="txtNQty" Background="White"   
                                 Text="{Binding FSSVERBR, Source={StaticResource ResourceKey=vwTMPFSSTUELI}, Converter={StaticResource ResourceKey=d1000}}" Width="80"></TextBlock>
                        <TextBlock Text="{Binding Source={Localization:Translate Word=损耗:}}"></TextBlock>
                        <TextBlock Name="txtW2" Width="30" Text="{Binding FSSVERL, Source={StaticResource ResourceKey=vwTMPFSSTUELI}, Converter={StaticResource ResourceKey=d100}}"></TextBlock>
                    </WrapPanel>
                </StackPanel>
                <Button FontSize="18" Height="40" Width="40" Margin="1,0,0,0" Click="btnRefreshAB15_Click">
                    <Button.Background>
                        <ImageBrush  ImageSource="Image/Convert.png" />
                    </Button.Background>
                </Button>
                <TextBlock Text="{Binding Source={Localization:Translate Word=应用}}" Margin="1,0,0,0"  VerticalAlignment="Center"></TextBlock>
                <!--Button FontSize="18" Height="40" Width="40" Margin="1,0,0,0" Click="btnSaveDECK_Click">
                    <Button.Background>
                        <ImageBrush  ImageSource="Image/Save.png" />
                    </Button.Background>
                </Button>
                <TextBlock Text="{Binding Source={Localization:Translate Word=保存}}" Margin="1,0,0,0" VerticalAlignment="Center"></TextBlock-->
            </WrapPanel>
            <Expander Header="{Binding Source={Localization:Translate Word=生产单}}" IsExpanded="True">
                <DataGrid  
                CanUserReorderColumns="True"  
                CanUserResizeRows="True" 
                CanUserSortColumns="True"                  
                AutoGenerateColumns="False"   
                EnableRowVirtualization="False"   
                IsSynchronizedWithCurrentItem="True"
                Height="200"
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwABPOS}}"  
                Margin="0,1,0,0" 
                >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=ABPAUFKRS}" Header=" "   Width="40" />
                        <DataGridTextColumn Binding="{Binding Path=ABPAUFLFD}" Header="{Binding Source={Localization:Translate Word=生产单}}"   Width="80" />
                        <DataGridTextColumn Binding="{Binding Path=ABPAUFPOS}" Header=""   Width="40" />
                        <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:Translate Word=颜色}}"   Width="60" />
                        <DataGridTextColumn Binding="{Binding Path=ABPGROE}" Header="{Binding Source={Localization:Translate Word=尺寸}}"   Width="40" />
                        <DataGridTextColumn Binding="{Binding Path=ABPSOLLMENGE7, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=数量}}"   Width="150" />
                    </DataGrid.Columns>
                </DataGrid  >
            </Expander>
            <Expander Header="{Binding Source={Localization:Translate Word=辅料需求}}" IsExpanded="True">
                <DataGrid  
                CanUserReorderColumns="True"  
                CanUserResizeRows="True" 
                CanUserSortColumns="True"                  
                AutoGenerateColumns="False"   
                EnableRowVirtualization="False"   
                IsSynchronizedWithCurrentItem="True"
                Height="200"
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwFDECK}}"  
                Margin="0,1,0,0" 
                >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=FDAUFKRS}" Header=" "   Width="40" />
                        <DataGridTextColumn Binding="{Binding Path=FDAUFLFD}" Header="{Binding Source={Localization:Translate Word=生产单}}"   Width="80" />
                        <DataGridTextColumn Binding="{Binding Path=FDAUFPOS}" Header=""   Width="40" />
                        <DataGridTextColumn Binding="{Binding Path=FDART}" Header="{Binding Source={Localization:Translate Word=物料}}"   Width="120" />
                        <DataGridTextColumn Binding="{Binding Path=FDFARBE}" Header="{Binding Source={Localization:Translate Word=颜色}}"   Width="60" />
                        <DataGridTextColumn Binding="{Binding Path=FDGROE}" Header="{Binding Source={Localization:Translate Word=尺码}}"   Width="60" />
                        <DataGridTextColumn Binding="{Binding Path=FDMENGE}" Header="{Binding Source={Localization:Translate Word=数量}}"   Width="60" />
                    </DataGrid.Columns>
                </DataGrid  >
            </Expander>
            <Expander Header="{Binding Source={Localization:Translate Word=面料需求}}" IsExpanded="True">
                <DataGrid  
                CanUserReorderColumns="True"  
                CanUserResizeRows="True" 
                CanUserSortColumns="True"                  
                AutoGenerateColumns="False"   
                EnableRowVirtualization="False"   
                Height="200"
                IsSynchronizedWithCurrentItem="True"
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwWDECK}}"  
                Margin="0,1,0,0" 
                IsTextSearchCaseSensitive="True"  
                >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=WDAUFKRS}" Header=" "   Width="40" />
                        <DataGridTextColumn Binding="{Binding Path=WDAUFLFD}" Header="{Binding Source={Localization:Translate Word=生产单}}"   Width="80" />
                        <DataGridTextColumn Binding="{Binding Path=WDAUFPOS}" Header=""   Width="40" />
                        <DataGridTextColumn Binding="{Binding Path=WDART}" Header="{Binding Source={Localization:Translate Word=面料}}"   Width="120" />
                        <DataGridTextColumn Binding="{Binding Path=WDFARBE}" Header="{Binding Source={Localization:Translate Word=颜色}}"   Width="60" />
                        <DataGridTextColumn Binding="{Binding Path=WDBEDARF,Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=数量}}"   Width="60" />
                    </DataGrid.Columns>
                </DataGrid  >
            </Expander>
        </StackPanel>
    </Grid>
</local:DocumentBase>
